import { Component, OnInit, inject } from '@angular/core';
import {
  ActivatedRoute,
  EventType,
  NavigationStart,
  Router,
} from '@angular/router';
import { filter } from 'rxjs';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
})
export class AppComponent implements OnInit {
  private router = inject(Router);

  ngOnInit(): void {
    // this.router.events
    //   .pipe(filter((e) => e.type === EventType.NavigationStart))
    //   .subscribe((e) => {
    //     console.log('Navigation start');
    //     console.log(e);
    //     console.log(this.router.url);
    //   });
    // this.router.events
    //   .pipe(filter((e) => e.type === EventType.NavigationEnd))
    //   .subscribe((e) => {
    //     console.log('Navigation end');
    //     console.log(e);
    //     console.log(this.router.url);
    //   });
  }
}
